home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / formline.cpp < prev    next >
C/C++ Source or Header  |  1994-10-10  |  2KB  |  58 lines

  1. #include "formline.h"
  2. #include "khbgi.h"
  3. #include "patterns.h"
  4.  
  5. void FormLine::show(loc xy, int len, char* text, int pat)
  6.     {
  7.     rect tmp(screenXL(xy.X), screenYT(xy.Y),
  8.          screenXR(xy.X + len) + area[border_type].origin.X
  9.         + area[border_type].corner.X,
  10.          screenYB(xy.Y) + area[border_type].origin.Y
  11.         + area[border_type].corner.Y
  12.         + pScreenSet->standart_height + 2);
  13.     Carcase::show(border_type, tmp);
  14.     bar(tmp = rect(tmp.origin + area[border_type].origin,
  15.       tmp.corner - area[border_type].corner),
  16.       (int)pColorSet->colors.BAK_COLOR,
  17.           (int)pColorSet->colors.FILL_COLOR, (uchar*)::pattern[pat]);
  18.     char c = text[len];
  19.     text[len] = '\0';
  20.     Line::outtextxy(tmp.origin, text, pat);
  21.     text[len] = c;
  22.     }
  23. ////////////////////////////
  24. void FormLine::outtextxy(loc xy, int len, char* text, int pat)
  25.     {
  26.     if(xy.X + len >= 79)
  27.         len = 78 - xy.X;
  28.     rect tmp(screenXL(xy.X) + area[border_type].origin.X,
  29.          screenYT(xy.Y) + area[border_type].origin.Y,
  30.          screenXR(xy.X + len) + area[border_type].origin.X,
  31.          screenYB(xy.Y) + area[border_type].origin.Y
  32.          + pScreenSet->standart_height + 1);
  33.     bar(tmp, (int)pColorSet->colors.BAK_COLOR,
  34.     (int)pColorSet->colors.FILL_COLOR, (uchar*)::pattern[pat]);
  35.  
  36. /*    struct viewporttype v;
  37.     getviewsettings(&v);
  38.     setviewport(v.left + tmp.origin.X, v.top + tmp.origin.Y,
  39.     v.right + tmp.corner.X, v.bottom + tmp.corner.Y, 1);
  40. */    Line::outtextxy(tmp.origin, text, pat);
  41. //    setviewport(v.left, v.top, v.right, v.bottom, v.clip);
  42.     }
  43. /////////////////////////
  44. /*
  45. void main()
  46.     {
  47.     if(!init_KNOW_HOW())
  48.         return;
  49.     setfillstyle(SOLID_FILL, pColorSet->colors.BAK_COLOR);
  50.     bar(0, 0, getmaxx(), getmaxy());
  51.  
  52.     FormLine f(SHOW_BORDER);
  53.     f.show(loc(10, 10), 40, "Hello, WORLD !", 16);
  54.     f.outtextxy(loc(10, 10), 40, "KNOW-HOW 4.x", 27);
  55.     close_KNOW_HOW();
  56.     closegraph();
  57.     }
  58. */